package de.fhk.fst.dvr

import de.fhk.fst.dvr.user.User

abstract class BaseController {

  boolean isLoggedIn() {
    return session.user != null
  }

  boolean isUserAdmin() {
    if (isLoggedIn()) {
      def user = User.findById(session.user.id)
      return user.isAdmin()
    }

    return false
  }
}
